package com.easylinkin.linkappapi.alarm.constant;

/**
 * <p>
 * 告警管理常量
 * </p>
 *
 * @author TongJie
 * @since 2020/4/30 15:01
 */
public interface AlarmConstant {

    enum AlarmStatus {
        /**
         * 2, 启用
         */
        ENABLED(2, "启用"),
        /**
         * 1, 停用
         */
        DISABLED(1, "停用");


        private final Integer type;
        private final String name;

        AlarmStatus(Integer type, String name) {
            this.type = type;
            this.name = name;
        }

        public Integer getType() {
            return type;
        }

        public String getName() {
            return name;
        }
    }

    /**
     * 处理状态
     */
    enum ProcessStatus {

        /**
         * 2, 已处理
         */
        PROCESSED(2, "已处理"),
        /**
         * 1, 未处理
         */
        NOT_PROCESSED(1, "未处理");


        private final Integer type;
        private final String name;

        ProcessStatus(Integer type, String name) {
            this.type = type;
            this.name = name;
        }

        public Integer getType() {
            return type;
        }

        public String getName() {
            return name;
        }

        /**
         * 通过 type 获取类型枚举
         */
        public static ProcessStatus valueOf(Integer type) {
            if (null == type) {
                return null;
            }
            switch (type) {
                case 2:
                    return PROCESSED;
                case 1:
                    return NOT_PROCESSED;
                default:
                    return null;
            }
        }

    }

    /**
     * 处理状态
     */
    enum ActionScopeEnum {


        /**
         * 1, 作用于型号
         */
        SCOPE_DEVICE_UNIT(1, "型号"),
        /**
         * 2, 作用于设备
         */
        SCOPE_DEVICE(2, "设备");


        private final Integer type;
        private final String name;

        ActionScopeEnum(Integer type, String name) {
            this.type = type;
            this.name = name;
        }

        public Integer getType() {
            return type;
        }

        public String getName() {
            return name;
        }

        /**
         * 通过 type 获取类型枚举
         */
        public static ActionScopeEnum valueOf(Integer type) {
            if (null == type) {
                return null;
            }
            switch (type) {
                case 1:
                    return SCOPE_DEVICE_UNIT;
                case 2:
                    return SCOPE_DEVICE;
                default:
                    return null;
            }
        }

    }

    /**
     * 消息推送类型 1-短信 2-邮件   3-短信+邮件
     */
    enum NoticeType {


        /**
         * 1, 短信
         */
        MESSAGE(1, "短信"),
        /**
         * 2, 邮件
         */
        EMAIL(2, "邮件"),

        /**
         * 3, 短信+邮件
         */
        MESSAGE_AND_EMAIL(3, "短信+邮件");


        private final Integer type;
        private final String name;

        NoticeType(Integer type, String name) {
            this.type = type;
            this.name = name;
        }

        public Integer getType() {
            return type;
        }

        public String getName() {
            return name;
        }

        /**
         * 通过 type 获取类型枚举
         */
        public static NoticeType valueOf(Integer type) {
            if (null == type) {
                return null;
            }
            switch (type) {
                case 1:
                    return MESSAGE;
                case 2:
                    return EMAIL;
                case 3:
                    return MESSAGE_AND_EMAIL;
                default:
                    return null;
            }
        }

    }


    /**
     * 通知模板类型 12-短信 13-邮件
     */
    enum NoticeTemplateTypeEnum {


        /**
         * 12, 短信模板
         */
        MESSAGE("12", "短信"),
        /**
         * 13, 邮件模板
         */
        EMAIL("13", "邮件");


        private final String type;
        private final String name;

        NoticeTemplateTypeEnum(String type, String name) {
            this.type = type;
            this.name = name;
        }

        public String getType() {
            return type;
        }

        public String getName() {
            return name;
        }

    }


}
